﻿using Windows.UI.ApplicationSettings;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls.Primitives;

namespace Win8nl.Controls
{
  public class BaseSettingsControl : Windows.UI.Xaml.Controls.UserControl
  {
    public BaseSettingsControl()
    {
      Loaded += SettingsControl_Loaded;
    }

    void SettingsControl_Loaded(object sender, RoutedEventArgs e)
    {
      DataContext = DataContext;
      Loaded -= SettingsControl_Loaded;

    }

    protected void OnBackButtonClicked(object sender, RoutedEventArgs e)
    {
      if (this.Parent is Popup)
      {
        ((Popup)Parent).IsOpen = false;
      }
      SettingsPane.Show();
    }
  }
}
